<template>
  <div class="hot-tags">
    <h3>热门标签</h3>
    <div class="tags-list">
      <a 
        v-for="(tag, index) in tags" 
        :key="index" 
        href="#" 
        class="tag-item" 
        @click.prevent="handleTagClick(tag)"
      >
        #{{ tag }}
      </a>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HotTags',
  props: {
    tags: {
      type: Array,
      default: () => [],
    },
  },
  methods: {
    handleTagClick(tagName) {
      this.$emit('tag-click', tagName)
    },
  },
}
</script>

<style scoped>
.hot-tags {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.hot-tags h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-item {
  display: inline-block;
  padding: 6px 12px;
  background: #f0f2f5;
  color: #646464;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.tag-item:hover {
  background: #e6e8eb;
  color: #333;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .hot-tags {
    padding: 12px;
  }
  
  .tag-item {
    padding: 5px 10px;
    font-size: 13px;
  }
}
</style>